from utils.SendMethod import SendMethod


class Guest:

    def __init__(self):
        self.url = "http://127.0.0.1:8000"

    # 添加嘉宾
    def add_guest(self, body):
            method = "post"
            url = self.url + "/api/add_guest/"
            return SendMethod.send_method(method, url, body=body)

    # 查询嘉宾
    def search_guest(self, params):
            method = "get"
            url = self.url + "/api/get_guest_list/"
            return SendMethod.send_method(method, url, params=params)


if __name__ == '__main__':
    guest = Guest()
    body_guest = {
        "eid": "1999",
        "realname": "sun",
        "phone": "13000000000",
        "email": "xxx@163.com.cn"
    }
    params_guest = {
        "eid": "1999",
        "phone": "13100000000"
    }
    print(guest.add_guest(body_guest))
    print(guest.search_guest(params_guest))